﻿using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using KenLib.BusinessManager;

public partial class APP_frmA_MCompManager : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {
        ((APP_MasterPage_appCom)this.Master).changeTitle("組合員企業情報管理");
        ((APP_MasterPage_appCom)this.Master).HideLiArea("frmA_frmA_MCompManager1");
        //Response.Write(Session["企業コード_2"].ToString());
        if (Session["役"] != null)
        {
            String 役 = Session["役"].ToString();
            if (役 == "1")
            {
                btn_組合員企業情報登録.Enabled = false;
                btn_実習実施場所情報登録.Enabled = false;
            }
        }
        else
        {
            Response.Redirect("~/frmD_Login.aspx");
        }
    }
    protected void btn_組合員企業情報参照_Click(object sender, ImageClickEventArgs e)
    {
        Session.Remove("Update_frmA_History_Fom_HistoryInfo");
        Session.Remove("GetYar_Fom_HistoryInfo");
        Session.Remove("Update_ComBranchInFo_To_CompBranchInput");
        Session.Remove("listValueCompBranchInput");
        Session.Remove("listValue_CompBranchInfo_To_CompBranchInput");
        Response.Redirect("frmA_CompBasicInfo.aspx");
    }

    protected void btn_組合員企業情報登録_Click(object sender, ImageClickEventArgs e)
    {
        Session.Remove("Update_frmA_History_Fom_HistoryInfo");
        Session.Remove("GetYar_Fom_HistoryInfo");
        Session.Remove("Update_ComBranchInFo_To_CompBranchInput");
        Session.Remove("listValueCompBranchInput");
        Session.Remove("listValue_CompBranchInfo_To_CompBranchInput");
        if (Session["役"].ToString() == "1")
        {
            Response.Redirect("frmA_CompBasicInfoInput.aspx");

        }
        else
        {
            本社情報Manager frm = new 本社情報Manager();
            DataTable dt = new DataTable();
            dt = frm.Select_MCompManager(Int32.Parse(Session["企業コード_2"].ToString()));
            //dt = frm.Select_MCompManager(190);
            string check = dt.Rows[0][0].ToString();
            if (check == null || check == "")
            {
                Session["ModeHiepHoi"] = "HiepHoi";
                Response.Redirect("frmA_CompBasicInfoInput.aspx");

            }
            else
            {
                Session.Remove("ModeHiepHoi");
                Session.Remove("ModeCongTy");
                Session.Remove("UpdateComBasic");
                Response.Redirect("frmA_CompBasicInfoCheck.aspx");
            }
        }
        Session.Remove("UpdateComBasic");
    }
    protected void btn_実習実施場所情報登録_Click(object sender, ImageClickEventArgs e)
    {
        Session.Remove("Update_frmA_History_Fom_HistoryInfo");
        Session.Remove("GetYar_Fom_HistoryInfo");
        Session.Remove("listValueCompBranchInput");
        Session.Remove("ID_CompBranchInput");
        Session.Remove("listValue_CompBranchInfo_To_CompBranchInput");
        Session.Remove("listValueCompBranchInput");
        Session.Remove("Update_ComBranchInFo_To_CompBranchInput");
        Session.Remove("listValueCompBranchInput");
        Session.Remove("listValue_CompBranchInfo_To_CompBranchInput");
        Session.Remove("Update_frmA_CompHistoryInput");
        Session.Remove("listValuefrmA_CompBranchHistoryInput");
        Response.Redirect("frmA_CompBranchInput.aspx");
    }
    protected void btn_実習実施場所情報参照_Click(object sender, ImageClickEventArgs e)
    {

        Response.Redirect("frmA_CompBranchInfo.aspx");
    }
}
